<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正则表达式匹配所有字符</title>
</head>
<body>
    <script>
        let hd = `
            <span>
            fjaklsf
            435(9(&(%&)))
        </span>`;

        // s模式忽略换行符
        console.log(hd.match(/.+/gs));

        // 原子表匹配所有字符 [\s\S] [\d\D] [\w\W]
        console.log(hd.match(/[\s\S]+/)[0]);
        console.log(hd.match(/[\d\D]+/)[0]);
        console.log(hd.match(/[\w\W]+/)[0]);
    </script>
</body>
</html>